# -*- coding: utf-8 -*-
# @Time    : 2023/6/3 21:35
# @Author  : lxy
# @Email   : 1612393119@qq.com
# @File    : classromm_page.py
# @Software: PyCharm
from pages.base_page import BasePage
from appium.webdriver.common.mobileby import MobileBy as By

class ClassroomPage(BasePage):
    # """
    # 课程页面
    # """
    my_course_locator=(By.XPATH,'//android.widget.TextView[@text=\"我的课程\"]')
    search_course_locator=(By.XPATH,'//android.widget.TextView[@text=\"想学点什么？\"]')
    course_click_locator=(By.XPATH,'//android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/androidx.drawerlayout.widget.DrawerLayout[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[2]/android.widget.TabHost[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.widget.RelativeLayout[1]/android.webkit.WebView[1]/android.webkit.WebView[1]/android.view.View[1]/android.view.View[1]/android.view.View[3]/android.view.View[3]/android.view.View[1]/android.view.View[1]/android.view.View[3]')


    # 点击我的课程按钮
    def my_course(self):
        self.find_element(self.my_course_locator).click()
    # 点击课堂页面搜索
    def search_course(self):
        self.find_element(self.search_course_locator).click()
    # 点击一个课程
    def click_course(self):
        self.find_element(self.course_click_locator).click()
